import os
import pygame

def get_window_position():
    pos = os.environ.get('SDL_VIDEO_WINDOW_POS')
    if pos:
        x, y = pos.split(',')
        return int(x), int(y)
    try:
        import ctypes
        user32 = ctypes.windll.user32
        hwnd = pygame.display.get_wm_info()['window']
        rect = ctypes.wintypes.RECT()
        ctypes.windll.user32.GetWindowRect(hwnd, ctypes.byref(rect))
        return rect.left, rect.top
    except Exception:
        return (100, 100)